package Algorithms.recursion;

/**
 * description: <br>
 * createTime: 2018/10/308:45 <br>
 *
 * @author zzh
 */
public class TriangleNumber {

    public static int print(int val) {
        if(val == 1) {
            System.out.println(val + " : " + 1);
            return 1;
        }
        int result = val + print(val -1);
        System.out.println(val + " : " + result);
        return result;
    }

    public static int calc(int val) {
        if(val == 1) {
            return 1;
        }
        return val + calc(val -1);
    }

    public static void main(String[] args) {
        print(11);
    }
}
